feat(memory): add RedisMemoryService#5919
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
Response from ADK Triaging Agent Hello @volkthienpreecha, thank you for creating this PR! We noticed that the Google Contributor License Agreement (CLA) check has failed. Before we can review and accept your contributions, please make sure to sign the CLA as described in the Before you begin section of our contribution guidelines. You can visit https://cla.developers.google.com/ to check your current agreements or sign a new one. This information is required for legal and licensing reasons to allow us to redistribute your contributions. Thank you for your cooperation! |
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
Problem:
ADK does not currently have a Redis-backed memory service. That means developers who want durable, self-hosted agent memory need to either use an existing hosted backend or keep memory in process with
InMemoryMemoryService.Solution:
I added
RedisMemoryServiceas a focused implementation of the existingBaseMemoryServicecontract.This PR adds Redis storage for memory events, lazy export from
google.adk.memory, optional dependency support throughgoogle-adk[redis], and service registry support forredis://andrediss://memory service URIs.Expected behavior:
After this change, developers can use Redis as a persistent memory backend. Sessions and events can be added to memory, searched by keyword, and scoped by
app_nameanduser_id, while keeping behavior aligned with the existingInMemoryMemoryService.Testing Plan
Unit Tests:
I added unit coverage for
RedisMemoryServiceacross session ingest, explicit event ingest, event appends, event deduping, session replacement, user scoping, case-insensitive search, empty sessions, and client cleanup.I also added service registry tests for
redis://andrediss://memory service URIs.Passed locally: